<?php

namespace app\api\controller;

use app\BaseController;
use app\common\model\TagModel;

class  Tags extends BaseController
{

    /**
     * @var  TagModel
     */
    private $model;

    public function initialize()
    {
        $this->model = new TagModel();
    }

    /**
     * 患者列表
     */
    public function index()
    {
        $result = [
            "status" => "no",
            "data" => [],
            "msg" => "查找失败"
        ];
        $option = $this->option();
        $result["status"] = "ok";
        $result["msg"] = "查找成功";

        $data = $this->model->pageData($option, '');
        $result["data"] = $data;

        return json($result);
    }

    //检查是否登录
    private function checkLogin()
    {
        $result = [
            "status" => "noLogin",
            "data" => [],
            "msg" => "请登录"
        ];

        if ($this->user == null) {
            return json($result);
        }
    }
}